package com.hzeport.bgs22emduty.outbound.db;

import com.github.pagehelper.PageInfo;
import com.hzeport.bgs22emduty.dto.DutydignInfoListDTO;
import com.hzeport.bgs22emduty.dto.DutydignInfoListoneDTO;
import com.hzeport.bgs22emduty.vo.dutydignInfo.DutydignInfoListVO;
import com.hzeport.bgs22emduty.vo.dutydignInfo.DutydignInfoListoneVO;
import com.hzeport.bgs22emduty.common.base.BaseRepositoryImpl;
import com.hzeport.bgs22emduty.entity.DutyScheduleInfo;
import com.hzeport.bgs22emduty.outbound.db.mapper.DutyScheduleInfoMapper;
import com.hzeport.bgs22emduty.outbound.DutyScheduleInfoRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.repository.RepositoryDefinition;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

/**
 * ${comments}
 *
 * @author code generator
 * @date 2022-12-02 11:21:59
 */
@Service
@Slf4j
public class DutyScheduleInfoRepositoryImpl extends BaseRepositoryImpl<DutyScheduleInfoMapper, DutyScheduleInfo> implements DutyScheduleInfoRepository {

    @Resource
    private DutyScheduleInfoMapper dutyScheduleInfoMapper;

    @Override
    public List<DutydignInfoListoneVO> listone(DutydignInfoListoneDTO dutydignInfoListoneDTO) {
        return dutyScheduleInfoMapper.listone(dutydignInfoListoneDTO);
    }

    @Override
    public List<DutydignInfoListVO> listForCustom(DutydignInfoListDTO dutydignInfoListDTO) {
        return dutyScheduleInfoMapper.listForCustom(dutydignInfoListDTO);
    }

    @Override
    public String getDtype(DutyScheduleInfo scheduleInfo) {
        return dutyScheduleInfoMapper.getDtype(scheduleInfo.getDutyTimesId(),scheduleInfo.getId());
    }

    @Override
    public List<DutyScheduleInfo> getTimeDTOForNow(String customnName, LocalDate today, LocalTime toLocalTime, LocalDate yesterday) {
        return dutyScheduleInfoMapper.getTimeDTOForNow(customnName,today,toLocalTime,yesterday);
    }
}
